﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Najak;

namespace Falon.Tiles
{
    public class SecretDoor : Tile
    {
        static private Texture2D _secretTexture;

        public SecretDoor(string textureName)
            : base(textureName, TileCollision.Normal)
        {
            MapCode = 'O';
        }
        public override void Draw(SpriteBatch spriteBatch, Vector2 offset, int column, int row)
        {
            if (!Game.IsEditorMode)
            {
                base.Draw(spriteBatch, offset, column, row);
            }
            else
            {
                if (_secretTexture == null)
                {
                    _secretTexture = Game.Instance.Content.Load<Texture2D>("Tiles/Secretdoor");
                }
                if (_secretTexture != null)
                {
                    // Draw it in screen space.
                    Vector2 loc = new Vector2(column * Tile.Size.X, row * Tile.Size.Y);
                    spriteBatch.Draw(_secretTexture, loc + offset, Color.White);
                }
            }
        } 
    }
    

}
